<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 不唠叨的章鱼
  Date: 2023/12/19
  Time: 2:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/base.css" />
    <link rel="stylesheet" href="css/detail.css" />
    <title></title>
</head>
<body>
<%@ include file="menu.jsp"%>
<br/>
<br/>
<a href="adddrug.do?drugid=${tDrug.drugid}"><button class="add-shopcar" style="border-radius: 12px;">商品添加</button></a>
    <table style="margin-left: 100px">
        <c:forEach items="${list}" var="tDrug">
        <tr>
            <td>
    <div class="d-center" style="margin-top: 100px;">
        <div class="goods-pic"><img style="border-radius: 12px;" src="/upload/${tDrug.img}" width="360px" height="400px"/></div>

        <div class="goods-detail">
            <h3 style="font-size: 30px">${tDrug.name}</h3>
            <div class="detail-red">
                <div class="red-col-1">
                    <table>
                        <tr style="margin-top: 5px"><td>价格： ￥${tDrug.price}</td></tr>

                        <tr style="margin-top: 20px"><td> 药品类别：${tDrug.drugclass}</td></tr>

                        <tr style="margin-top: 20px"><td> 治疗类别：${tDrug.cureclass}</td></tr>

                        <tr style="margin-top: 20px"><td>药品规格：${tDrug.drugsize}</td></tr>
                    </table>
                </div>
            </div>

            <div><span style="font-size: 25px;color: black;"><em>功效说明：</em></span></div>
            <div><span style="font-size: 18px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${tDrug.fexplain}
            </div>


            <div style="margin-top: 50px;">
                <a href="adddrug.do?drugid=${tDrug.drugid}"> <button class="add-shopcar" style="border-radius: 12px;">商品编辑</button></a>
                <a href="javascript:deletedrug(${tDrug.drugid})"><button class="add-shopcar" style="border-radius: 12px;">删除</button></a>
            </div>
        </div>
    </div>
            </td>
        </tr>
        </c:forEach>
    </table>

<script>
    function deletedrug(drugid){
        var select = confirm("你确定要删除该商品的所有信息吗");
        if(select == true){
            alert("删除id="+drugid+"的商品信息");
            document.location.href="deteldrug.do?drugid="+drugid;
        }
    }
</script>

</body>
</html>
